package com.design.decorator;

/**
 * @author leali
 * @title: ScrollBarDecorator
 * @projectName design
 * @description: 滚动条装饰类：具体装饰类
 * @date 2022/1/2 23:16
 */
public class ScrollBarDecorator extends ComponentDecorator {
    public ScrollBarDecorator(Component component) {
        super(component);
    }

    public void setScrollBar() {
        System.out.println("为构件增加滚动条-ScrollBarDecorator");
    }

    /**
     * 1.添加自身装饰
     * 2.继承父类装饰功能
     */
    @Override
    public void display() {
        this.setScrollBar();
        super.display();
    }
}
